package com.gqb.reflect;

import java.lang.reflect.Constructor;
import java.lang.reflect.Type;

public class reflectConstrutor {
	public static void main(String[] args) throws Exception {
		Constructor constructor = String.class
				.getConstructor(StringBuffer.class);
		String str1 = (String) constructor.newInstance(new StringBuffer("abc"));
		System.out.println(str1);
		String str2 = String.class.newInstance();
		Constructor[] constructors = Class.forName("java.lang.String")
				.getConstructors();
		for (int i = 0; i < constructors.length; i++) {
			Type[] types = constructors[i].getGenericParameterTypes();
			for (Type type : types) {
				System.out.print(type);
			}
			System.out.println();
		}
	}
}
